package springcloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: LeeRui
 * 2021/1/17 下午 1:24
 **/
@SpringBootApplication
public class ConsumerStartApp {
    public static void main(String[] args) {
        SpringApplication.run(ConsumerStartApp.class, args);
    }

    //Spring工厂创建RestTemplate模板
    @Bean
    @LoadBalanced  //Ribbon负载均衡注解
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
